# encoding: utf-8
""" 
@version: v1.0 
@author: autumner 
@license: Apache Licence  
@contact: 18322313385@163.com 
@site:  https://gitee.com/autumner/pythoncookbook
@software: PyCharm 
@file: net_hmac_authe_client.py 
@time: 2019/7/12 下午2:51
"""
'''
认证服务访问的客户端
'''

from socket import socket, AF_INET, SOCK_STREAM
from net_hmac_authe import client_authenticate
# With in a client
secret_key = b'peekaboo'
s = socket(AF_INET, SOCK_STREAM)
s.connect(('localhost', 18000))
client_authenticate(s, secret_key)
s.send(b'Hello hmac authe')
resp = s.recv(1024)
print(resp)
s.close()